/*
 *  Copyright (C) 2009  Peter Kist & Jan Ripke
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __gfx_manager_factory_h
#define __gfx_manager_factory_h 1

#include <string>

#include <boost/unordered_map.hpp>
#include <boost/shared_ptr.hpp>

#include <mediator/Interface.h>
#include <galaxy/ModuleManager.h>

namespace galaxy {

    class ManagerFactory
    {
    public:

        /** shorthand for a shared pointer to a manager */
        typedef boost::shared_ptr<ModuleManager> ManagerPtr;
        /** shorthand for the manager map type */
        typedef boost::unordered_map<int, ManagerPtr> ManagerMap;

    private:


        static ManagerFactory * m_Singleton;    /**< singleton manager factory */
        ManagerMap              m_Managers;     /**< manager hash */

    public:
        ManagerFactory(void);
        ~ManagerFactory(void);

        /** get the specified manager */
        static ManagerPtr& getManager (mediator::Category category);
        /** get map of all available managers */
        static ManagerMap& getManagerMap ();

    private:

        static ManagerFactory& singleton () { return *m_Singleton; };

        static ModuleManager * createGfxManager ();
        static ModuleManager * createInputManager ();
        static ModuleManager * createLogicManager ();
    };

} // namespace galaxy

#endif // __gfx_manager_factory_h
